package com.hsp.codeblock;

public class CodeBlockDetail03 {
    public static void main(String[] args) {
        BBB bbb = new BBB();
        System.out.println(AAA.a);

    }
}

class AAA {
    public static int a=3;
    static {
        System.out.println("AAA 的静态代码块");
    }
    {
        System.out.println("AAA 的普通代码块");
    }
    public AAA(){
        System.out.println("AAA()构造器被调用");
    }
}
class BBB extends AAA{
    {
        System.out.println("BBB() 代码块被调用");
    }

    public BBB(){
        //(1)super()
        //(2)调用本类的普通代码块
        System.out.println("BBB() 构造器被调用");
    }
}